package com.have.blog.commons.feign;

import com.have.blog.commons.config.feign.FeignConfiguration;
import com.have.blog.commons.fallback.PictureFeignFallback;
import com.have.blog.commons.vo.FileVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "blog-picture", configuration = FeignConfiguration.class, fallback = PictureFeignFallback.class)
public interface PictureFeignClient {

    /**
     * 获取文件信息的接口
     * @param fileIds 文件UID
     * @param code 分隔符
     * @return
     */
    @GetMapping(value = "/file/getPicture")
    String getPicture(@RequestParam("fileIds") String fileIds, @RequestParam("code")String code);

    /**
     * 通过URL List上传图片
     * @param fileVo
     * @return
     */
    @PostMapping(value = "/file/uploadPicsByUrl")
    String uploadPicsByUrl(FileVo fileVo);


    /**
     * 初始化用户网盘容量大小
     * @param adminUid
     * @param maxStorageSize
     * @return
     */
    @PostMapping(value = "/storage/initStorageSize")
    String initStorageSize(@RequestParam("adminUid") String adminUid, @RequestParam("maxStorageSize") Long maxStorageSize);

    /**
     * 调整网盘大小
     * @param adminUid
     * @param maxStorageSize
     * @return
     */
    @PostMapping(value = "/storage/editStorageSize")
    String editStorageSize(@RequestParam("adminUid") String adminUid, @RequestParam("maxStorageSize") Long maxStorageSize);

    /**
     * 通过管理员UID列表获取储存信息
     * @param adminUidList
     * @return
     */
    @GetMapping(value = "/storage/getStorageByAdminUid")
    String getStorageByAdminUid(@RequestParam("adminUidList") List<String> adminUidList);
}
